#ifndef DESTROYBALL_H
#define DESTROYBALL_H

#include <QWidget>

#include "ccontrol.h"

namespace Ui {
class destroyball;
}

class destroyball : public QWidget
{
    Q_OBJECT

public:
    explicit destroyball(QWidget *parent = 0);
    ~destroyball();

    void showEvent(QShowEvent *e);

    void resizeEvent(QResizeEvent *);

private:
    Ui::destroyball *ui;

    CControl *m_pCtrl;

    QList<CBall*> m_newBallList;

    // 初始状态下 小球的个数
    int m_startBallCnt;

    // 下一步生成小球的数量
    int m_nextBallCnt;

    // 小球的种类
    int m_ballTypeCnt;

    // 最少的消除小球的数量
    int m_leastDestoyCnt;

    // 矩阵的尺寸
    int m_MatrixWidth, m_MatrixHeight;

    // 历史成绩
    QList < int > m_HistoricalScore;

private:


private slots:
    // 更新分数
    void updateScore(int score);

    // 小球移动后的操作
    void BallHasMoved(QStack<QPoint> path);

    void CreatedNewBall(QList<CBall> newball);
    void on_btnRestart_clicked();
};

#endif // DESTROYBALL_H
